@import "../lib/iconfont/iconfont.css";

.editor {
  width: 100%;
  height: 100%;

  &-left,
  &-right {
    //&==.editor  &-left  .editor-left
    position: absolute;
    width: 270px;
    top: 0;
    bottom: 0;
    background-color: white;
    overflow-x: hidden;
    overflow-y: auto;
  }
  &-left {
    left: 0;
    &-item {
      width: 250px;
      margin: 20px auto;
      display: flex; // flex布局
      justify-content: center;
      align-items: center;
      background-color: #fff;
      padding: 20px;
      box-sizing: border-box;
      cursor: move;
      user-select: none;
      min-height: 100px;
      position: relative; // 相对位置
      > span {
        position: absolute;
        top: 0;
        left: 0;
        background-color: rgb(96, 205, 224);
        color: #fff;
        padding: 4px;
      }
      &::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        opacity: 0.2;
      }
    }
  }
  &-right {
    right: 0;
  }
  &-top {
    position: absolute;
    right: 280px;
    left: 280px;
    height: 80px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    &-button {
      width: 60px;
      height: 60px;
      display: flex;
      justify-content: center;
      flex-direction: column;
      align-items: center;
      background-color: rgba(0, 0, 0, 0.3);
      color: #fff;
      user-select: none;
      cursor: pointer;
      & + & {
        margin-left: 3px;
      }
    }
  }
  &-container {
    // .editor-container
    padding: 80px 270px 0;
    height: 100%;
    box-sizing: border-box;
    &-canvas {
      overflow: scroll;
      height: 100%;
      &__content {
        margin: 20px auto;
        width: 800px;
        height: 600px;
        background-color: yellow;
        position: relative;
      }
    }
  }
}

.editor-block {
  position: absolute;
  &::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
}

// 选中虚线
.editor-block-focus {
  &::after {
    border: 2px dashed red;
  }
}

.line-x {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed red;
}
.line-y {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed red;
}

.editor-block-preview {
  &::after {
    display: none;
  }
}

// 右键菜单
.dropdown {
  display: none;
  position: absolute;
  background-color: #fff;
  box-shadow: 2px 2px #ccc;
}

.dropdown-isShow {
  display: block;
}

// 菜单项
.dropdown-item {
  line-height: 30px;
  width: 100px;
  border-bottom: 1px solid #ccc;
  text-align: center;
  user-select: none;
  cursor: pointer;
}
